package com.tensai.teach.beijing.utils.data;

import com.tensai.teach.beijing.utils.data.domain.RoadFromTo;
import lombok.Getter;

import java.util.*;

/**
 * 地图关系表
 * @author Tensai
 */
@Getter
public enum Relationship {
	// 路口信息
	WUXI_7(7L,
			new RoadFromTo(1873593L, 1873583L, "S", 6L),
			new RoadFromTo(1872760L, 1871090L, "W", 11L),
			new RoadFromTo(1871076L, 1871076L, "N", 18L),
			new RoadFromTo(1871226L, 1871084L, "E", 14L)
	),

	WUXI_11(11L,
			new RoadFromTo(1871179L, 1871151L, "S", 13L),
			new RoadFromTo(1871159L, 1871073L, "W", 17L),
			new RoadFromTo(1871086L, 1871086L, "N", 27L),
			new RoadFromTo(1871119L, 1871300L, "E", 7L)
			);

	private final Long junctionId;

	private final List<RoadFromTo> roadFromToList = new ArrayList<>();


	Relationship(Long junctionId, RoadFromTo... roadFromTos) {
		this.junctionId = junctionId;
		Collections.addAll(roadFromToList, roadFromTos);
	}

	public static Map<Long, Relationship> getRelationshipList(){
		Map<Long, Relationship> map = new HashMap<>();
		 Arrays.stream(Relationship.values()).forEach(it-> map.put(it.getJunctionId(), it));
		 return map;
	}
}
